package egovframework.npqs.pqi.mobile;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;

import com.slidingmenu.lib.SlidingMenu;


public class ActivityInit extends BaseActivity {

	public static final int Event_Init_OpenJoin = 1;
	public static final int Event_Init_OpenLogin = 2;
	public static final int Event_Init_OpenMain = 3;
	public static final int Event_Init_OpenLoginLoading = 4;
	public static final int Event_Init_RecvGmcRegister = 7;

	
	static ActivityInit instance = null;
	public static ActivityInit getInstance() {
		return instance;
	}

	public static void clearInstance(ActivityInit value) {
		if (value == instance) {
			instance = null;
		}
	}
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);	
	    // TODO Auto-generated method stub	    
	    try {	    	
	    	//View frameLayoutFragment = findViewById(R.id.frameLayoutFragment);		    	
	    	requestWindowFeature(Window.FEATURE_NO_TITLE);
//	    	overridePendingTransition(0, 0);
	    	setContentView(R.layout.activity_init);
	    	instance = this;
	    	
			setSlidingMenu(savedInstanceState);
			
			
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}

	@Override
	public void onBackPressed() {
			Log.i("activityinit","onback");
		if(getBackStackCount() <= 1) {
			finish();
		} else {
			super.onBackPressed();
		}		
	}

	@Override
	public void onDestroy() {
		try {
			clearInstance(this);
		} catch (Exception e) {
			// TODO: handle exception
		}
		super.onDestroy();
	}

	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		switch (requestCode) {

		}
	}

	private void setSlidingMenu(Bundle savedInstanceState) {
		View v = new View(this);
		setBehindContentView(v);
		getSlidingMenu().setSlidingEnabled(true);
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	}

	
}
